@import '../../style/themes/index.less';

@grids-prefix-cls: ~'@{prefix}-grids';
@grid-item-prefix-cls: ~'@{prefix}-grid';

.@{grids-prefix-cls} {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  background-color: #fff;

  &:before {
    content: ' ';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 2px;
    border-top: 2px solid #d9d9d9;
    color: #d9d9d9;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
  }

  &:after {
    content: ' ';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    bottom: 0;
    border-left: 2px solid #d9d9d9;
    color: #d9d9d9;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scaleX(0.5);
    transform: scaleX(0.5);
  }
}

.@{grid-item-prefix-cls} {
  position: relative;
  float: left;
  padding: 20px 20px;
  width: 33.33333333%;
  box-sizing: border-box;
  flex-basis: 33.333%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;

  &:before {
    content: ' ';
    position: absolute;
    right: 0;
    top: 0;
    width: 2px;
    bottom: 0;
    border-right: 2px solid #d9d9d9;
    color: #d9d9d9;
    -webkit-transform-origin: 100% 0;
    transform-origin: 100% 0;
    -webkit-transform: scaleX(0.5);
    transform: scaleX(0.5);
  }

  &:after {
    content: ' ';
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    height: 2px;
    border-bottom: 2px solid #d9d9d9;
    color: #d9d9d9;
    -webkit-transform-origin: 0 100%;
    transform-origin: 0 100%;
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
  }

  &:active {
    background-color: #ececec;
  }

  &-icon {
    width: 56px;
    height: 56px;
    font-size: 56px;
    margin: 0 auto;

    & > img {
      display: block;
      width: 100%;
      height: 100%;
    }
  }

  &-label {
    display: block;
    text-align: center;
    color: rgba(0, 0, 0, 0.9);
    font-size: 28px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
  }
}
.@{grid-item-prefix-cls}-icon + .@{grid-item-prefix-cls}-label {
  margin-top: 15px;
  margin-bottom: 8px;
}
